﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace HouodeFun.TrainCenter.IDAL
{
    public interface IBaseRepository<T> where T: class,new()
    {
        int AddEnties(params T[] entities);
        T AddEntity(T entity);
        int DeleteEntity(T entity);
        int DeleteBy(System.Linq.Expressions.Expression<Func<T, bool>> whereLambda);
        T UpdateEntity(T entity);
        
        IQueryable<T> LoadEntities(System.Linq.Expressions.Expression<Func<T, bool>> whereLambda);
        IQueryable<T> LoadPageEntities<S>(System.Linq.Expressions.Expression<Func<T, bool>> whereLambda, System.Linq.Expressions.Expression<Func<T, S>> orderBy, int pageSize, int pageIndex, out int totalCount, bool isAsc);
    }
}
